const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin'); //html 自动引入插件

module.exports = {
  mode:'development',
  devtool:'inline-source-map', 
  devServer:{
    static:'./dist',
  },
  entry: {
    index:  './src/index.js',
  }, //入口文件
  output: {
    filename: '[name].bundle.js',
    path: path.resolve(__dirname, 'dist'),
    clean:true,  //清除
    publicPath:'/',
  },
  plugins:[
    new HtmlWebpackPlugin({
      title:'Development'
    }),
  ],
  optimization:{
    runtimeChunk:'single'
  }
}